const Sequelize = require('sequelize'); //引入Sequelize模块
const db = require('../db');

//定义model
const Remark = db.define('Remark',{
    //主键
    id:{type:Sequelize.INTEGER,primaryKey:true,allowNull:false,autoIncrement:true },
    //创建文章
    s_id:{type:Sequelize.INTEGER},
    //创建用户
    u_id:{type:Sequelize.INTEGER,primaryKey:true,allowNull:false},
    //隶属于哪个评论
    r_id:{type:Sequelize.INTEGER},
    //内容
    content:{type:Sequelize.TEXT},
    //点赞数
    like:{type:Sequelize.BIGINT},
    //创建时间
    created_at:{type:Sequelize.DATE},
    //创建id
    created_id:{type:Sequelize.INTEGER},
    //修改id
    updated_id:{type:Sequelize.INTEGER},
    //修改时间
    updated_at:{type:Sequelize.DATE},

}, {
        underscored:true,
        tableName:'remark',
        //timestamps: false//禁用创建时间戳
});

module.exports = Remark;